home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / __MANDEL / MANDELBR / CROOTSCA.C < prev    next >
Text File  |  1992-03-28  |  900b  |  43 lines

  1. /* CRootScaleDialog.c */
  2.  
  3. #include "CMandelApp.h"
  4. #include <Commands.h>
  5. #include <CFloatText.h>
  6. #include "CRootScaleDialog.h"
  7. #include "CMandelDoc.h"
  8. #include <CWindow.h>
  9.  
  10. void CRootScaleDialog::IRootScaleDialog(    short DLOGid,
  11.                                             CMandelDoc *aMandelDoc,
  12.                                             CDirectorOwner *aSupervisor)
  13. {
  14.     CFloatText *aEditItem;
  15.     
  16.     IDLOGDirector(DLOGid, aSupervisor);
  17.     FailNIL(aMandelDoc);
  18.     itsMandelDoc = aMandelDoc;
  19.     
  20.     aEditItem = (CFloatText *)itsWindow->FindViewByID(3/*kRootScaleEdit*/);
  21.     aEditItem->SetFloatValue(itsMandelDoc->itsRootScale);
  22. }
  23.  
  24. void CRootScaleDialog::DoCommand(long aCmd)
  25. {
  26.     CFloatText *aEditItem;
  27.  
  28.     switch (aCmd)
  29.     {
  30.         case cmdOK:
  31.             if (Validate())
  32.             {
  33.                 aEditItem = (CFloatText *)itsWindow->FindViewByID(3);
  34.                 itsMandelDoc->itsRootScale = aEditItem->GetFloatValue();
  35.                 itsMandelDoc->DoImage();
  36.             }
  37.             break;
  38.             
  39.         default:
  40.             inherited::DoCommand(aCmd);
  41.             break;
  42.     }
  43. }